package cn.hy.preparelesson.common.constant;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 项目常量
 */
@Component
@ConfigurationProperties(prefix = "core.config")
public class ProjectConstant {
    /**
     * 当前应用编码
     */
    public static final String APP_CODE = "preparelessonapp";
    public static final String PROJECT_NAME = "PREPARE-LESSON";

    /**
     * 当前应用的访问域名（必须）
     */
    public static String hostName;
    /**
     * 云桌面api地址
     */
    public static String dtApi;

    /**
     *
     * 模板消息Api
     */
    public static String msgApi;

    /**
     * 模板Id
     */
    public static String templateCommonId;

    /**
     * 用户信息sessionKey
     */
    public static final String LOGIN_USER_SESSION_KEY = PROJECT_NAME + "_LOGIN_USER_KEY";

    /**
     * ueditor文件上传路径
     */
    public static String ueditorUploadLocation = "/opt/upload/ueditor";
    /**
     * ueditor文件访问前缀
     */
    public static String ueditorVisitPrefix = "/ueditor";

    /**
     * 文件上传路径
     */
    public static String fileUploadLocation = "/opt/upload/file";
    /**
     * 文件文件访问前缀
     */
    public static String fileVisitPrefix = "/file";
    /**
     * 图片上传路径
     */
    public static String imgUploadLocation = "/opt/upload/img";
    /**
     * 图片访问前缀
     */
    public static String imgVisitPrefix = "/img";
    /**
     * 用户sessionKey
     */
    public static String sessionKey = "LOGIN_USER";

    public void setHostName(String hostName) {
        ProjectConstant.hostName = hostName;
    }


    public void setDtApi(String dtApi) {
        ProjectConstant.dtApi = dtApi;
    }

    public void setMsgApi(String msgApi) {
        ProjectConstant.msgApi = msgApi;
    }


    public void setTemplateCommonId(String templateCommonId) {
        ProjectConstant.templateCommonId = templateCommonId;
    }
}
